package com.itheima.test5;

public class CalculatorDemo {
    public static void main(String[] args) {
        useCalculator(new Calculator() {
            @Override
            public int Calc(int a, int b) {
                return a+b;
            }
        });

        useCalculator((int a ,int b)->{
            return a + b;
        });
    }

    public static void useCalculator(Calculator c){
        int d =c.Calc(2,110);
        System.out.println(d);
    }
}


interface Calculator{
    int Calc(int a ,int b);
}